/*     */ package com.openbravo.pos.forms;
/*     */ 
/*     */ import com.openbravo.pos.config.JFrmConfig;
/*     */ import com.openbravo.pos.instance.AppMessage;
/*     */ import com.openbravo.pos.instance.InstanceManager;
/*     */ import java.awt.Dimension;
/*     */ import java.awt.EventQueue;
/*     */ import java.awt.Toolkit;
/*     */ import java.awt.event.WindowAdapter;
/*     */ import java.awt.event.WindowEvent;
/*     */ import java.rmi.RemoteException;
/*     */ import javax.swing.JFrame;
/*     */ 
/*     */ public class JRootKiosk extends JFrame
/*     */   implements AppMessage
/*     */ {
/*  37 */   private InstanceManager m_instmanager = null;
/*     */   private JRootApp m_rootapp;
/*     */   private AppProperties m_props;
/*     */ 
/*     */   public JRootKiosk()
/*     */   {
/*  45 */     setUndecorated(true);
/*  46 */     setResizable(false);
/*     */ 
/*  48 */     initComponents();
/*     */   }
/*     */ 
/*     */   public void initFrame(AppProperties props)
/*     */   {
/*  54 */     this.m_props = props;
/*     */ 
/*  56 */     this.m_rootapp = new JRootApp();
/*     */ 
/*  58 */     if (this.m_rootapp.initApp(this.m_props))
/*     */     {
/*  60 */       if ("true".equals(props.getProperty("machine.uniqueinstance"))) {
/*     */         try
/*     */         {
/*  63 */           this.m_instmanager = new InstanceManager(this);
/*     */         }
/*     */         catch (Exception e)
/*     */         {
/*     */         }
/*     */       }
/*  69 */       add(this.m_rootapp, "Center");
/*     */ 
/*  71 */       setTitle("PFPOS - 2.30.2");
/*     */ 
/*  73 */       Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
/*  74 */       setBounds(0, 0, d.width, d.height);
/*     */ 
/*  76 */       setVisible(true);
/*     */     } else {
/*  78 */       new JFrmConfig(props).setVisible(true);
/*     */     }
/*     */   }
/*     */ 
/*     */   public void restoreWindow() throws RemoteException {
/*  83 */     EventQueue.invokeLater(new Runnable() {
/*     */       public void run() {
/*  85 */         if (JRootKiosk.this.getExtendedState() == 1) {
/*  86 */           JRootKiosk.this.setExtendedState(0);
/*     */         }
/*  88 */         JRootKiosk.this.requestFocus();
/*     */       }
/*     */     });
/*     */   }
/*     */ 
/*     */   private void initComponents()
/*     */   {
/* 101 */     setDefaultCloseOperation(0);
/* 102 */     addWindowListener(new WindowAdapter() {
/*     */       public void windowClosed(WindowEvent evt) {
/* 104 */         JRootKiosk.this.formWindowClosed(evt);
/*     */       }
/*     */       public void windowClosing(WindowEvent evt) {
/* 107 */         JRootKiosk.this.formWindowClosing(evt);
/*     */       }
/*     */     });
/*     */   }
/*     */ 
/*     */   private void formWindowClosing(WindowEvent evt) {
/* 114 */     this.m_rootapp.tryToClose();
/*     */   }
/*     */ 
/*     */   private void formWindowClosed(WindowEvent evt)
/*     */   {
/* 120 */     System.exit(0);
/*     */   }
/*     */ }

/* Location:           D:\PowerFulPOS-2.30.2\openbravopos.jar
 * Qualified Name:     com.openbravo.pos.forms.JRootKiosk
 * JD-Core Version:    0.6.0
 */